package ${project.packageName}.${project.moduleName}.interfaces.converter;

import ${project.packageName}.${project.moduleName}.domain.${tableStructure.className}.${tableStructure.classNameUppercase}Entity;
import ${project.packageName}.${project.moduleName}.domain.${tableStructure.className}.vo.${tableStructure.classNameUppercase}QueryVO;
import ${project.packageName}.${project.moduleName}.interfaces.dto.${tableStructure.classNameUppercase}PageDTO;
import ${project.packageName}.${project.moduleName}.interfaces.dto.${tableStructure.classNameUppercase}UploadDTO;
import ${project.packageName}.${project.moduleName}.interfaces.param.${tableStructure.classNameUppercase}PageParam;
import ${project.packageName}.${project.moduleName}.interfaces.param.${tableStructure.classNameUppercase}SaveParam;
import ${project.packageName}.${project.moduleName}.interfaces.param.${tableStructure.classNameUppercase}UpdateParam;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * ${tableStructure.tableComment}转换器
 *
 * @author zhangren
 * @date 2022/11/14
 */
@Mapper
public interface I${tableStructure.classNameUppercase}Converter {
    /**
     * 角色converter实现
     */
    ${project.packageName}.${project.moduleName}.interfaces.converter.I${tableStructure.classNameUppercase}Converter IMPL = Mappers.getMapper(${project.packageName}.${project.moduleName}.interfaces.converter.I${tableStructure.classNameUppercase}Converter.class);


    /**
     * ${tableStructure.tableComment}命令对象转领域对象
     *
     * @param ${tableStructure.className}SaveParam ${tableStructure.tableComment}命令对象
     * @return ${tableStructure.classNameUppercase}Entity
     */
    ${tableStructure.classNameUppercase}Entity commandToDo(${tableStructure.classNameUppercase}SaveParam ${tableStructure.className}SaveParam);

    /**
     * ${tableStructure.tableComment}命令对象转领域对象
     *
     * @param ${tableStructure.className}UpdateParam ${tableStructure.tableComment}更新命令对象
     * @return ${tableStructure.classNameUppercase}Entity
     */
    ${tableStructure.classNameUppercase}Entity commandToDo(${tableStructure.classNameUppercase}UpdateParam ${tableStructure.className}UpdateParam);

    /**
     * ${tableStructure.tableComment}分页命令对象转领域对象
     *
     * @param ${tableStructure.className}PageParam ${tableStructure.tableComment}分页命令对象
     * @return ${tableStructure.classNameUppercase}Entity
     */
    ${tableStructure.classNameUppercase}Entity pageCommandToDo(${tableStructure.classNameUppercase}PageParam ${tableStructure.className}PageParam);

    /**
     * do对象转dto对象
     *
     * @param ${tableStructure.className}Entity do
     * @return ${tableStructure.classNameUppercase}DTO dto
     */
    ${tableStructure.classNameUppercase}PageDTO doToDTO(${tableStructure.classNameUppercase}Entity ${tableStructure.className}Entity);

    /**
     * do list对象转dto list对象
     *
     * @param doList list对象
     * @return List<${tableStructure.classNameUppercase}DTO>
     */
    List<${tableStructure.classNameUppercase}PageDTO> doListToDtoList(List<${tableStructure.classNameUppercase}Entity> doList);

    /**
     * ${tableStructure.tableComment}分页命令对象转值对象
     *
     * @param ${tableStructure.className}PageParam ${tableStructure.className}PageParam
     * @return ${tableStructure.classNameUppercase}QueryVO
     */
    ${tableStructure.classNameUppercase}QueryVO commandToVo(${tableStructure.classNameUppercase}PageParam ${tableStructure.className}PageParam);

    /**
     * do对象转dto对象
     *
     * @param ${tableStructure.className}Entity ${tableStructure.className}Entity
     * @return ${tableStructure.classNameUppercase}UploadDTO
     */
    ${tableStructure.classNameUppercase}UploadDTO doToUploadDTO(${tableStructure.classNameUppercase}Entity ${tableStructure.className}Entity);
}
